<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<title>后台管理系统</title>
<%@include file="header.jsp"%>
<script type="text/javascript">
	$(function() {
		   function closeTab(menu, type){
            var allTabs = $("#operating-space").tabs('tabs');
            var allTabtitle = [];
            $.each(allTabs,function(i,n){
                var opt=$(n).panel('options');
                if(opt.closable)
                    allTabtitle.push(opt.title);
            });

            switch (type){
                case 1 :
                    var curTabTitle = $(menu).data("tabTitle");
                    $("#operating-space").tabs("close", curTabTitle);
                    return false;
                break;
                case 2 :
                    for(var i=0;i<allTabtitle.length;i++){
                        $("#operating-space").tabs('close', allTabtitle[i]);
                    }
                break;
                case 3 :
            
                break;
                case 4 :
            
                break;
                case 5 :
            
                break;
            }
            
        }
		
		$("#operating-space").tabs({onContextMenu:function(e, title,index){
			 e.preventDefault();
			 if(index>0){
			 	   $("#right-menu").menu('show', {
                            left: e.pageX,
                            top: e.pageY
                        }).data("tabTitle", title);
			 };
		
		}});
		
		 	$("#right-menu").menu({
                onClick : function (item) {
                    closeTab(this, item.name);
                }
            });
	});
	
	
	function reloadPanel(){
	
		var tab = $("#operating-space").tabs('getSelected');
		tab.panel("refresh");
	
	}
	
</script>
</head>
<body class="easyui-layout">
	<div data-options="region:'north'" style="height:40px;overflow: hidden">
	
	<div class="easyui-panel" data-options="fit:true" style="overflow: hidden">
	
			<div data-options="region:'west'" style="float: left;padding:5px">
               	  欢迎使用--<span style="color: red;">${sessionScope.user.name}</span>
            </div>
	
		 <div data-options="region:'east'" style="float: right;padding: 5px">
	        <a href="${rootURL}logout.html" class="easyui-linkbutton" data-options="plain:true">退出登录</a>
	        <a href="#" class="easyui-menubutton" data-options="menu:'#mm2',iconCls:'icon-help'">帮助</a>
         </div>
    </div>
	
	<div id="mm2" style="width:100px;">
        <div>说明</div>
        <div>反馈</div>
        <div>关于</div>
    </div>
	
	
	</div>
	
	
	
	
	<div data-options="region:'south',split:true" style="height:20px;"></div>
	<div data-options="region:'west',split:true,href:'${rootURL}leftmenu.html'" title="导航菜单" style="width:180px;"></div>
	<div data-options="region:'center'">
	
		<div class="easyui-tabs" data-options="fit:true,tools:'#tab-tools'" id="operating-space">
			<div title="公告" style="padding:10px">这是一个测试</div>
		</div>
	
	</div>
	

 	<div id="right-menu" class="easyui-menu" style="width:120px;">
         <div id="mm-tabclose" data-options="name:1">关闭</div>
        <div id="mm-tabcloseall" data-options="name:2">全部关闭</div>
    </div>
    
    
    
      <div id="tab-tools">
        <a href="javascript:void(0)" class="easyui-linkbutton" data-options="plain:true,iconCls:'icon-reload'" onclick="reloadPanel()"></a>
    </div>
	
</body>
</html>
